<!--

    Copyright (C) 2011 Moss Computing <support@mosscomputing.com>

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<html>
<head>
<style type="text/css">
body {
	background-color: #d0e4fe;
}

table,th,td {
	border: 1px solid black;
}
</style>
</head>
<body>

<h3>OSLEF (Open Small-Loan Exchange Format)</h3>

<p>The purpose of this document is to define the OSLEF
specification.</p>

<h3>Introduction</h3>

<p>OSLEF data is represented by a directory containing CSV files.
The basic structure of these files must conform to the following CSV
specification:</p>

<a href="http://tools.ietf.org/html/rfc4180">http://tools.ietf.org/html/rfc4180</a>

<p>The first record in each file is a header record which assigns a
unique name to each column in the file. The following records must
contain data corresponding to these columns.</p>

<p>Additionally, to facilitate the flattening-out of one-to-many
relationships within loan data, an OSLEF-compliant CSV file has two
kinds of columns. The first kind may only be specified once. An example
of this is the loan_id column in the loans.csv file. The second kind may
be specified multiple times using a column name prefix followed by a
name that makes the column unique. A column prefix follows the format
PREFIX:NAME. For example, a loan might have more than phone number by
which to contact an applicant. In this case it would be possible to have
two phone number columns: 'phone:home' and 'phone:work'.</p>

<h3>Files Overview</h3>
<p>There are three distinct CSV files in the OSLEF format.</p>
<ul>
	<li>
	<p>loans.csv - this is the primary CSV file, as it contains most of
	the information related to a given loan. installments.csv - contains
	installment plan information. Each record references a record in the
	loans.csv file.</p>
	</li>

	<li>
	<p>history.csv - contains loan history information, including
	payments and other loan servicing activities which affect the balances
	of a loan's accounts (principal, fees, etc). Each record references a
	record in the loans.csv file.</p>
	</li>

	<li>
	<p>installments.csv - contains information on loan installment
	plans. Each record references a record in the loans.csv file.</p>
	</li>
</ul>

<h3>loans.csv - Columns</h3>

${loanColumns}

<h3>installments.csv - Columns</h3>

${instColumns}

<h3>history.csv - Columns</h3>

${histColumns}

</body>
</html>
